package com.qzd.Factory.simplefactorypattern;

/**
 * 工厂类
 */
public class CouseFactory {
    /**
     *
     * @param className 类名
     * @return
     */
    public ICouse create(Class<? extends ICouse> className)throws Exception{
        /*if(null!=className && !("".equals(className))){
            return (ICouse)Class.forName(className).newInstance();
        }
        return null;
    }*/
        if(null!=className){
            return className.newInstance();
        }
        return null;
    }
}
